home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 359_11 / patch5.000 / EMU387_E15.CC < prev    next >
C/C++ Source or Header  |  1991-09-11  |  740b  |  64 lines

  1. #include "emu.h"
  2. #include "const.h"
  3.  
  4. static void fld_const(reg &c)
  5. {
  6.   if (full())
  7.     return;
  8.   top--;
  9.   r_mov(c, st());
  10.   status_word &= ~SW_C1;
  11. }
  12.  
  13. void fld1()
  14. {
  15.   fld_const(CONST_1);
  16. }
  17.  
  18. void fldl2t()
  19. {
  20.   fld_const(CONST_L2T);
  21. }
  22.  
  23. void fldl2e()
  24. {
  25.   fld_const(CONST_L2E);
  26. }
  27.  
  28. void fldpi()
  29. {
  30.   fld_const(CONST_PI);
  31. }
  32.  
  33. void fldlg2()
  34. {
  35.   fld_const(CONST_LG2);
  36. }
  37.  
  38. void fldln2()
  39. {
  40.   fld_const(CONST_LN2);
  41. }
  42.  
  43. void fldz()
  44. {
  45.   fld_const(CONST_Z);
  46. }
  47.  
  48. FUNC emu_15_table[] = {
  49.   fld1, fldl2t, fldl2e, fldpi, fldlg2, fldln2, fldz, emu_bad
  50. };
  51.  
  52. void emu_15()
  53. {
  54.   if (modrm > 0277)
  55.   {
  56.     (emu_15_table[modrm&7])();
  57.   }
  58.   else
  59.   {
  60.     // fldcw
  61.     control_word = *(short *)get_modrm();
  62.   }
  63. }
  64.